#ifndef PYHP_CONFIG
#define PYHP_CONFIG

/**
 * @file config.h
 * Configuration management for pyhp
 */

#include <httpd.h>
#include <http_config.h>

typedef struct {
    char * mode;
    char * log;
    int log_level;

    char * tmp_path;

    char * session_path;
    int session_timeout;
    char * session_name;

    int session_backend;
    char *session_db_uri;
    char *session_db_user;
    char *session_db_pass;
} pyhp_config;

typedef enum { PyHPLog_Apache, PyHPLog_Web, PyHPLog_None } PyHPLogLocation;
typedef enum { PyHP_DEBUG, PyHP_INFO, PyHP_WARN, PyHP_ERR } PyHPLogType;
typedef enum { PyHPSessionFile, PyHPSessionDb } PyHPSessionType;

void * pyhp_make_config(apr_pool_t * p, server_rec *s);

pyhp_config * pyhp_get_config(request_rec * r);
int pyhp_config_isdevel(request_rec *r);

PyHPLogLocation pyhp_config_loglocation(request_rec *r);

PyHPLogType pyhp_config_loglevel(request_rec *r);
char *pyhp_loglevel_to_string(PyHPLogType ll, char *output_buffer, int buffer_size);

int pyhp_config_sesstimeout(request_rec *r);
char *pyhp_sessiontimeout_to_string(int ll, char *output_buffer, int buffer_size);

PyHPSessionType pyhp_config_sessbackend(request_rec *r);
char *pyhp_sessionbackend_to_string(PyHPSessionType ll, char *output_buffer, int buffer_size);


#endif

